// 引入路由
const Router = require('koa-router');
// 引入处理函数
const { verifyUser, handlePassword } = require('../middleware/user.middleware')
const { create, login } = require('../controller/user.controller');
// 创建根路由
const userRouter = new Router({ prefix: '/user' });

// 创建用户
userRouter.post('/', verifyUser, handlePassword, create);
// 用户登录
userRouter.post('/login', verifyUser, handlePassword, login);


// 抛出路由
module.exports = userRouter;